import request from '@/utils/request';

export interface StudentScoreVO {
  name: string;
  age: number;
  gender: string;
  className: string;
  chinese: number;
  math: number;
  english: number;
  physics: number;
  biology: number;
  chemistry: number;
  politics: number;
  history: number;
  geography: number;
  attendance: string;
  performance: string;
}

export interface StudentScorePageParam {
  pageNum: number;
  pageSize: number;
  className?: string;
  gender?: string;
}

export interface StudentScorePageResult {
  pageNum: number;
  pageSize: number;
  total: number;
  list: StudentScoreVO[];
}

/**
 * 获取学生成绩列表
 * @param param 分页查询参数
 */
export function getStudentScoreList(param: StudentScorePageParam) {
  return request.get<any, { data: StudentScorePageResult }>('/studentScore/list', { params: param });
}

/**
 * 导出学生成绩数据到Excel
 * @param param 分页查询参数
 */
export const exportStudentScore = (param: StudentScorePageParam) => {
  return request.get('/studentScore/export', {
    params: param,
    responseType: 'blob'
  });
};

/**
 * 下载学生成绩导入模板
 */
export const downloadStudentScoreTemplate = () => {
  return request.post('/studentScore/template', {}, { responseType: 'blob' });
};



